/**
 * Created with IntelliJ IDEA.
 * User: Katerina
 * Date: 15.01.13
 * Time: 1:47
 * To change this template use File | Settings | File Templates.
 */
package ru.gameChangers.homework.businessModels {
import flash.display.Sprite;
import flash.geom.Point;

public class GridItemFrame extends Sprite {
    private static const THICKNESS:int = 0.1;

    private var startPoint:Point;
    private var endPoint:Point;
    private var frameColor:int;

    public function GridItemFrame(x:int, y:int, width:int, height:int, color:int) {
        this.graphics.lineStyle(THICKNESS, color);
        this.graphics.drawRect(x, y, width, height);
        startPoint = new Point(x,  y);
        endPoint = new Point(width, height);
        frameColor = color;
    }

    public function setThickness(thickness:int):void {
        graphics.clear();
        this.graphics.lineStyle(thickness, frameColor);
        this.graphics.drawRect(startPoint.x, startPoint.y, endPoint.x, endPoint.y);
    }
}
}
